//
//  TabBarViewController.m
//  Food
//
//  Created by 千锋 on 15/12/26.
//  Copyright (c) 2015年 xiaoqiang. All rights reserved.
//

#import "TabBarViewController.h"
#import "MenuViewController.h"
#import "TopicViewController.h"
#import "MyViewController.h"
@interface TabBarViewController ()

@end

@implementation TabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self createViewControllers];
}
-(void)createViewControllers
{
    MenuViewController*menuVC=[[MenuViewController alloc]init];
    UINavigationController*menuNavi=[[UINavigationController alloc]initWithRootViewController:menuVC];
    UIImage*menuGrayImage=[[UIImage imageNamed:@"main_bottom_tab_recipe_gray"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIImage*menuRedImage=[[UIImage imageNamed:@"main_bottom_tab_recipe_red"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UITabBarItem*menuItem=[[UITabBarItem alloc]initWithTitle:@"菜谱" image:menuGrayImage selectedImage:menuRedImage];
    menuNavi.tabBarItem=menuItem;
    TopicViewController*topicVC=[[TopicViewController alloc]init];
    UINavigationController*topicNavi=[[UINavigationController alloc]initWithRootViewController:topicVC];
    UIImage*topicGrayImage=[[UIImage imageNamed:@"main_bottom_tab_pai_gray"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIImage*topicRedImage=[[UIImage imageNamed:@"main_bottom_tab_pai_red"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UITabBarItem*topicItem=[[UITabBarItem alloc]initWithTitle:@"话题" image:topicGrayImage selectedImage:topicRedImage];
    topicNavi.tabBarItem=topicItem;
    MyViewController*myVC=[[MyViewController alloc]init];
    UINavigationController*myNavi=[[UINavigationController alloc]initWithRootViewController:myVC];
    UIImage*myGrayImage=[[UIImage imageNamed:@"main_bottom_tab_user_gray"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIImage*myRedImage=[[UIImage imageNamed:@"main_bottom_tab_user_red"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UITabBarItem*myItem=[[UITabBarItem alloc]initWithTitle:@"话题" image:myGrayImage selectedImage:myRedImage];
    myNavi.tabBarItem=myItem;
    self.viewControllers=@[menuNavi,topicNavi,myNavi];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
